#include <stdio.h>
int F(int a)
{
    int square = 0;
    square = a * a;
    if (square % 10000 == a
        || square % 1000 == a
        || square % 100 == a
        || square % 10 == a
        || square % 1 == a)
    {
        return 1;
    }
    else
    {
        return 0;
    }
    
}
int main()
{
    int i = 0;
    int sum = 0;
    for (i = 0; i <= 1; i++)
    {
        int ret = F(i);
        if (1 == ret)
        {
            sum++;
        }
    }
    printf("%d", sum);
    return 0;
}